#include "tplunaryexpression.h"

TplUnaryExpression::TplUnaryExpression(QObject *parent):
    TplExpression(parent) {
}

TplUnaryExpression::~TplUnaryExpression() {
#ifdef TPL_DEBUG
    qDebug() << "Deleting object TplUnaryExpression: " << this << endl;
#endif
}

void TplUnaryExpression::setContext(QMap<QString, QVariant> *context) {
    this->context = context;

    if(value.canConvert<QObject*>()) {
        QObject* tmp = qvariant_cast<QObject *>(value);
        TplExpression* expr = qobject_cast<TplExpression*>(tmp);
        if(expr) {
            expr->setContext(context);
        }
    }
}

void TplUnaryExpression::setValue(const QVariant &value) {
    this->value = value;
}
